package cn.yza.Kotlin.test

/**
@author Honglixi
@create 2022-06-01 17:43
 */
fun main() {
    val listOf: List<String> = listOf<String>("first", "second", "fourteenth")
    println(listOf.last())
    print("12.345-6.A".split(".","-"))
    println()
    parsePath("src/main/java/cn/yza/Kotlin/test/test05.kt")
}
fun parsePath(path: String) {
    val directory = path.substringBeforeLast("/")
    val fullName = path.substringAfterLast("/")
    val fileName = fullName.substringBeforeLast(".")
    val extension = fullName.substringAfterLast(".")

    println("Dir: $directory, name: $fileName, ext: $extension")
}